package com.hhss.qishi.DPtest.designpattern.adapter;

import java.util.Enumeration;
import java.util.Iterator;

/**
 * Enumberation 适配 Iterator
 */
public class EnumberationIterator implements Iterator {

    private Enumeration enumeration;

    public EnumberationIterator(Enumeration enumeration){
        this.enumeration = enumeration;
    }

    @Override
    public boolean hasNext() {
        return enumeration.hasMoreElements();
    }

    @Override
    public Object next() {
        return enumeration.nextElement();
    }
}
